﻿@model IEnumerable<KnowledgeCommunity.Model.UserAccount>

@{
    ViewBag.Title = "Search";
    Layout = "~/Views/Shared/_Layout_zone.cshtml";
}


<div class="contentcontainer">
    <div class="headings">
        <h2>查询</h2>
    </div>
    <div class="contentbox">
        @using (Html.BeginForm("Search", "Account", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            <table width="100%" border="0" id="MyTable" cellpadding="0" cellspacing="0">
            <tbody>
            <tr>
                <th>用户名</th>
                <td>
                    <input type="text" id="s_title" name="s_title"/>
                </td>
                <th>用户角色</th>
                <td>
                    <select id="s_role">
                      <option value="0">--请选择--</option>
                      <option value="1">注册会员</option>
                      <option value="2">系统管理员</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th>起始时间</th>
                <td>
                    <input type="text" id="s_time" name="s_time"/>
                </td>
                <th>结束时间</th>
                <td>
                    <input type="text" id="e_time" name="e_time" />
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    <input type="submit" value=" 查询 >> " class="btn" />
                </td>
            </tr>  
            </tbody>
            </table>
        }
        <div style="clear: both;"></div>
    </div>
</div>

<div class="contentcontainer">
    <div class="headings altheading">
        <h2>用户列表</h2>
    </div>
    <div class="contentbox">
        <table width="100%">
            <thead>
                <tr>
                    <th>用户名</th>
                    <th>角色</th>
                    <th>状态</th>
                    <th>注册时间</th>
                    <th>管理</th>
                    <th><input name="" type="checkbox" value="" id="checkboxall" /></th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                <tr class="alt">
                    <td>
                        @item.UserName
                    </td>
                    <td>
                        @Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.UserRole),item.Role)
                    </td>
                    <td>
                        @Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.UserState),item.State)
                    </td>
                    <td>
                        @item.AddTime
                    </td>
                    <td>
                        <a href="@Url.Action("Edit", "Account", new { id=item.Id})" title=""><img src="@Url.Content("~/Content/img/icons/icon_edit.png")" alt="Edit" /></a>
                    </td>
                    <td><input type="checkbox" value="@item.Id" name="checkall" /></td>
                </tr>
                }
            </tbody>
        </table>
        <div style="clear: both;"></div>
    </div>     
</div>